home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / src / Vector / TODO < prev    next >
Text File  |  1992-04-13  |  3KB  |  69 lines

  1. Vector.h
  2.  Bug in ... in constructor, using va_arg.
  3.  The arguments in ... cannot be passed by reference. macro va_arg does funny
  4.  casting and does not enforce argument passing correctly, especially in case
  5.  of passing by reference.
  6.  
  7. prepend, remove_duplicates
  8.  Don't call constructors or operator= on the elements of this->data
  9.  
  10.  
  11.  operator[], fill, copy
  12.  When checking array boundaries, instead of
  13.    if (n < 0 || n >= this->number_elements)    // If index out of range
  14.  do:
  15.    if ((unsigned long) n >= this->number_elements)
  16.  The cast makes negative n look very large.
  17. DONE
  18.  
  19.  operator==, position, search, push_new, remove, remove_duplicates, replace,
  20.  replace_all
  21.  This sits in a loop calling (*this->compare).  Instead, make this->compare
  22.  default to NULL, and have two loops: one for the default case where
  23.  operator== on the value type is used, and another calling (*this->compare).
  24. operator== and search are special cases
  25. DONE
  26.  
  27.  search, push_new, remove, remove_duplicates, replace, replace_all
  28.  there ought to be a general purpose, protected searching method, which is
  29.  fast (see above) used by all these methods.
  30. Used find - DONE
  31.  
  32.  copy, push, push_new, append, prepend, insert_before, insert_after
  33.  There needs to be a general purpose protected grow method, like in String.
  34.  The grow method should call resize to do most of the work.
  35. DONE
  36.  
  37.  reverse
  38.  This could be re-written to use pointers instead of indices.
  39.  Dividing the length by two can be eliminated, and a check for when
  40.  the top and bottom pointers meet or cross substituted.
  41.  
  42.  remove, remove_duplicates, prepend, insert_before, insert_after
  43.  These need to be re-written to do their work in-place (i.e. no copying
  44.  to a temporary)  The new and delete calls should go away.
  45. DONE - prepend left as-is because it's likely to grow the vector
  46.  
  47.  insert_before, insert_after
  48.  There are two versions of each of these.  They should all call a common
  49.  private method which does the real work of inserting something at some index.
  50. DONE
  51.  
  52.  type##_vector_heap_sort
  53.  This needs to be merged into the sort method.  There's no reason for
  54.  this friend function to exist, and it causes an extra .o file to be
  55.  produced by the implement script.
  56. DONE
  57.  
  58.  sort
  59.  Use the ansi C qsort function, instead of having one in the template.
  60.  If you feel that the heap sort algorithm is superior, write a general
  61.  purpose hsort function, with the same calling sequence as qsort.
  62.  hsort can be in the library instead of the template.
  63. DONE
  64.  
  65.  Vector<Type>(int n, Type* data)
  66.  Write a new constructor which makes a fixed size vector which shares
  67.  storage with the data argument
  68. DONE
  69.